package fm.card.entity;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;

import java.lang.reflect.Field;

public class PersonInfo {
    private String name;
    private String userLogo;
    private String company;
    private String job;
    private String phone;
    private String qq;
    private String wechat;
    private String code;

    public PersonInfo() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUserLogo() {
        return userLogo;
    }

    public void setUserLogo(String userLogo) {
        this.userLogo = userLogo;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getWechat() {
        return wechat;
    }

    public void setWechat(String wechat) {
        this.wechat = wechat;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public DBObject toDBObject() throws Exception {
        BasicDBObject obj = new BasicDBObject();
        Field[] fields = this.getClass().getFields();
        for (Field field : fields) {
            Object value = field.get(this);
            obj.put(field.getName(), value);
        }
        return obj;
    }
}
